<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link href="/management/css/css.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="/dwr/util.js"></script>
		<script type="text/javascript" src="/js/common/commanFunction.js"></script>
		<title>我的资料</title>
		<script type="text/javascript">
			function adduser(){
				if(!isLength("password",6,20,"密码")){
					return false;
				}else if(!issuzm("password","密码")){
					return false;
				}else if($("password").value != $("repassword").value ){
					alert("两次密码不相同！");
					$(repassword).focus();
					return false;
				}else{
					document.getElementById("userform").action="/management/user/updatemyuser.do";
	    	    	document.getElementById("userform").submit();
	    	    	return false;
				}
			}
			function issuzm(id,name){
			  var reg1 = /^[0-9a-zA-Z]+$/g;
					var str = $(id).value;
					var r1 = str.match(reg1);
					if(r1 == null){
						alert(name+"只能由字母和数字组成！");
						$(id).focus();
						return false;
					}
			   return true;
		}
		</script>
	</head>

	<body>

		<table width="80%" align="center" style="border:solid 1px #000000"
			bgcolor="#3366FF" cellpadding="1" cellspacing="1">
			<tr bgcolor="#FFFFFF">
				<td align="center" colspan="4" class="title">
					基本资料
				</td>
			</tr>
			<tr bgcolor="#FFFFFF">
				<td align="center" width="25%" class="boldfont">
					用户名:
				</td>
				<td align="center" width="25%">
					${syuserinfo.username}
				</td>
				<td align="center" width="25%" class="boldfont">
					密码:
				</td>
				<td align="center" width="25%">
					${syuserinfo.password }
				</td>
			</tr>
			<tr bgcolor="#FFFFFF">
				<td align="center" width="25%" class="boldfont">
					姓名:
				</td>
				<td align="center" width="25%">
					${syuserinfo.xingming }
				</td>
			</tr>
		</table>
		<br />
		<div id="c">
			<form action="" name="userform" id="userform" method="post" style="margin:0px;">
				<table width="80%" align="center" style="border:solid 1px #000000"
					bgcolor="#3366FF" cellpadding="1" cellspacing="1">
					<tr bgcolor="#FFFFFF">
						<td align="center" colspan="4" class="title">
							修改密码
						</td>
					</tr>
					<tr bgcolor="#FFFFFF">
						<td align="center" width="25%" class="boldfont">
							用户密码:
						</td>
						<td align="left" colspan="2" width="75%">
							<input type="password" name="password" id="password" value=""
								maxlength="20" />
						</td>
					</tr>
					<tr bgcolor="#FFFFFF">
						<td align="center" width="20%" class="boldfont">
							重复密码:
						</td>
						<td align="left" colspan="2" width="80%">
							<input type="password" name="repassword" id="repassword" value=""
								maxlength="20" />
							<input type="hidden" name="returnpath" id="returnpath"
								value="/management/user/getmyuser.do" maxlength="20" />
							<input type="hidden" name="username" id="username"
								value="${syuserinfo.username}" />
							<input type="hidden" name="id" id="id" value="${syuserinfo.id}" />
							<input type="hidden" name="xingming" id="xingming"
								value="${syuserinfo.xingming}" />
							<input type="hidden" name="roleid" id="roleid"
								value="${syuserinfo.syRoleinfo.id}" />
						</td>
					</tr>
					<tr bgcolor="#FFFFFF">
						<td align="center" colspan="4">
							<input type="button" name="button1" value=" 提 交 "
								onclick="return adduser();" />
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<input type="reset" name="reset1" value=" 重 置 " />
						</td>
					</tr>
				</table>
			</form>
		</div>
		<br />
		
	<script type="text/javascript" src="/js/common/dialog.js"></script>
	<script type="text/javascript">
  		window.onload=new function(){
  			  var msg = "${message}";
	     	  if(msg != ""){
	     	  	if(msg==1){
		     	  	msg="修改成功";
				}else if(msg==2){
					msg="修改失败";
				}
	    	    showMessage(msg);
	          }
  		}
  	</script>
	</body>
</html>

